package com.logou.controller;

import com.logou.domain.Article;
import com.logou.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;


@Controller
@RequestMapping("/article")
public class ArticleController {
    @Autowired
    private ArticleService articleService;
    @GetMapping("/index")
    public String toIndex(Model model){
        Page<Article> list =articleService.findAll();
        model.addAttribute("list",list);
        return "client/index";
    }
}
